package com.perfma.xtest.tool.x;

import com.google.common.base.Splitter;

import java.util.List;

/**
 * @author: junhui.si
 * @date: 2022-09-05 14:58
 **/
public class ApiDemo {
    public static void main(String[] args) {
        String str = "@ApiModelProperty(\"问题id\")\n" +
                "    private Long id;\n" +
                "    @ApiModelProperty(\"问题名称\")\n" +
                "    private String name;\n" +
                "    @ApiModelProperty(\"问题描述\")\n" +
                "    private String desc;\n" +
                "    @ApiModelProperty(\"优先级\")\n" +
                "    private String level;\n" +
                "    @ApiModelProperty(\"状态\")\n" +
                "    private String state;\n" +
                "    @ApiModelProperty(\"关联记录\")\n" +
                "    private String sceneReportName;\n" +
                "    @ApiModelProperty(\"创建人\")\n" +
                "    private String creator;\n" +
                "    @ApiModelProperty(\"创建时间\")\n" +
                "    private String createTime;";

        List<String> list = Splitter.on("\n").splitToList(str);
        for (int i = 0; i < list.size(); i++) {
            if (i % 2 == 1) {
                String s = list.get(i);
                s = s.trim();
                s = Splitter.on(" ").splitToList(s).get(2).replace(";", "");

                String s0 = list.get(i - 1);
                s0 = Splitter.on("\"").splitToList(s0).get(1);
                System.out.println(s + ": " + s0);
            }
        }
    }


}
